Use @UseFilters() at method or controller level. For global registration use app.useGlobalFilters() (no DI support) or the APP_FILTER token (full DI support, preferred). Passing the class reference to @UseFilters() is preferred over an instance when the filter has dependencies — NestJS resolves it through the DI container.
Resolution order when an exception is thrown: method → controller → global.
The first filter whose @Catch() type matches the thrown exception handles it.
Pass class reference to @UseFilters(MyFilter) for DI support; pass instance (new MyFilter()) for no-DI cases.
app.useGlobalFilters() — simple but cannot inject services.
APP_FILTER token — filter is a full NestJS provider with constructor injection.